package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.CustomModelMapper;
import com.ruoyi.ora.domain.CustomModel;
import com.ruoyi.ora.service.ICustomModelService;

/**
 * 模式配置Service业务层处理
 * 
 * @author liuwp
 * @date 2025-03-19
 */
@Service
public class CustomModelServiceImpl implements ICustomModelService 
{
    @Autowired
    private CustomModelMapper customModelMapper;

    /**
     * 查询模式配置
     * 
     * @param id 模式配置主键
     * @return 模式配置
     */
    @Override
    public CustomModel selectCustomModelById(Long id)
    {
        return customModelMapper.selectCustomModelById(id);
    }

    /**
     * 查询模式配置列表
     * 
     * @param customModel 模式配置
     * @return 模式配置
     */
    @Override
    public List<CustomModel> selectCustomModelList(CustomModel customModel)
    {
        return customModelMapper.selectCustomModelList(customModel);
    }

    /**
     * 根据业务主键查询一条记录：模式配置
     *
     * @param customModel 模式配置
     * @return 模式配置
     */
    @Override
    public CustomModel selectOneCustomModel(CustomModel customModel)
    {
        return customModelMapper.selectOneCustomModel(customModel);
    }

    /**
     * 新增模式配置
     * 
     * @param customModel 模式配置
     * @return 结果
     */
    @Override
    public int insertCustomModel(CustomModel customModel)
    {
        customModel.setCreateTime(DateUtils.getNowDate());
        return customModelMapper.insertCustomModel(customModel);
    }

    /**
     * 修改模式配置
     * 
     * @param customModel 模式配置
     * @return 结果
     */
    @Override
    public int updateCustomModel(CustomModel customModel)
    {
        return customModelMapper.updateCustomModel(customModel);
    }

    @Override
    public int updateCustomModelCondition(CustomModel customModel, CustomModel customModelCondition)
    {
        return customModelMapper.updateCustomModelCondition(customModel, customModelCondition);
    }

    /**
     * 批量删除模式配置
     * 
     * @param ids 需要删除的模式配置主键
     * @return 结果
     */
    @Override
    public int deleteCustomModelByIds(Long[] ids)
    {
        return customModelMapper.deleteCustomModelByIds(ids);
    }

    /**
     * 删除模式配置信息
     * 
     * @param id 模式配置主键
     * @return 结果
     */
    @Override
    public int deleteCustomModelById(Long id)
    {
        return customModelMapper.deleteCustomModelById(id);
    }

    /**
     * 条件删除模式配置
     *
     * @param customModel 模式配置
     * @return 结果
     */
    @Override
    public int deleteCustomModelByCondition(CustomModel customModel)
    {
        return customModelMapper.deleteCustomModelByCondition(customModel);
    }

}
